import { _decorator, Component, Node } from 'cc';
import AbstractComponent from '../base/AbstractComponent';
import { Label } from 'cc';
import UtilTool from '../tools/UtilTool';
import { tween } from 'cc';
import { Vec3 } from 'cc';
import { App } from '../App';
const { ccclass, property } = _decorator;

/**
 * 中奖后弹出的奖励界面
 */
@ccclass('Reward')
export class Reward extends AbstractComponent {

    @property(Label)
    label_coin : Label = null;

    @property(Label)
    label_usdt : Label = null;

    @property(Node)
    bgNode : Node = null;

    start() {
        this.bgNode.setScale(new Vec3(0.1,0.1,0.1))
        tween(this.bgNode).to(0.2, { scale: new Vec3(1,1,1) }, {easing:"quadIn"}).start()
    }

    initData(usdtNumber) {
        this.label_coin.string = Math.floor(usdtNumber * 10).toString() // 1USDT = 10金币, 显示金币数量
        this.label_usdt.string = UtilTool.formatStr(App.language.getLanguageLab(2064), usdtNumber) // 显示USDT数量
    }
    
}

